<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>${_title}</title>
    <script src="${_js}/jquery.min.js"></script>

    <link href="${_css}/bootstrap.min.css" rel="stylesheet">
    <link href="${_font}/css/font-awesome.min.css" rel="stylesheet">
    <link href="${_css}/animate.min.css" rel="stylesheet">
    <link href="${_css}/custom.css" rel="stylesheet">
    <link href="${_css}/icheck/flat/green.css" rel="stylesheet">

    <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->

</head>


<body style="background: #F7F7F7;">
<div class="">
        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_title">
                        <h2>线下提现</h2>
                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content">

                        <form class="form-horizontal form-label-left" novalidate>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">用户名</label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                	<input type="text" id="userName" name="userName" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>
                            
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">流水号</label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                	<input type="text" id="ssnCode" name="ssnCode" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>
                            
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="re-password">金额
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                   <input type="text" id="money" name="money" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>      
                            
                                                                  
                            <div class="ln_solid"></div>
                            <div class="form-group">
                                <div class="col-md-6 col-md-offset-3">
                                    <button type="button" onclick="javascript:history.go(-1)" class="btn btn-primary">返回前一页</button>
                                    <button type="button" id="rechargeBtn" class="btn btn-success">确认</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
  <script type="text/javascript">
    //控制金额栏位只能输入数字
  	$("#money").keyup(function () {
        $(this).val($(this).val().replace(/[^0-9.]/g, ''));
    }).bind("paste", function () {  //CTR+V事件处理    
        $(this).val($(this).val().replace(/[^0-9.]/g, ''));
    }).css("ime-mode", "disabled"); //CSS设置输入法不可用
    	
	//点击确认按钮
	$("#rechargeBtn").click(function(){
    	var username = $.trim($("#userName").val());
    	var ssnCode = $.trim($("#ssnCode").val());
    	var money = $.trim($("#money").val());
		if(userName == ""){
			alert("请输入用户名！");
			return;
		}
		if(ssnCode == ""){
			alert("请输入流水号！");
			return;
		}
		if(money == ""){
			alert("请输入金额！");
			return;
		}  	
		
		//money = parseFloat(money);
		
   		$.ajax({
            type: "POST",
            dataType: "json",
            async: false,
            url: '/admin/recharge/offLineRechargeSubmit',
            data: {'username':username, 'ssnCode':ssnCode, 'money':money},
            success: function(result){
            	alert(result.msg);
				if(result.code==-1){
		        	window.location.href="/admin/recharge/list?status=success";	            		 	
				}
            }
        }); 
	});
	
	
  </script>
</body>
</html>